package com.xiaoxi.compositemode;

import com.xiaoxi.compositemode.composite.Directory;
import com.xiaoxi.compositemode.composite.File;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.compositemode
 * @ClassName Main
 * @Description TODO
 * @Date 2023/3/14 9:37
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        Directory entry = new Directory("root");
        Directory bin = new Directory("bin");
        File vi = new File("vi", 20);
        File latex = new File("latex", 30);
        bin.add(vi);
        bin.add(latex);
        Directory tmp = new Directory("tmp");
        Directory usr = new Directory("usr");
        entry.add(bin);
        entry.add(tmp);
        entry.add(usr);
        entry.printList("");
        System.out.println(entry.getSize());

        System.out.println(latex.pwd());
        System.out.println(tmp.pwd());
    }
}
